import {defineStore} from 'pinia'

export const useAdminInfoStore = defineStore('adminInfo', {
    //存储数据的地方
    state() {
        return {
            admin: {}
        }
    },
    //actions里放一个一个方法
    actions: {
        setAdminInfo(admin) {
            this.admin = admin
        },
        removeAdminInfo(value) {
            this.admin = {}
        }
    },
    persist: {
        enabled: true,  //开启缓存，默认会存储在本地localstorage
    }
})